# CmakeLists.txt in DemoUI

FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTSVG TRUE)
SET(QT_USE_QTSCRIPT TRUE)
INCLUDE(${QT_USE_FILE})

INCLUDE_DIRECTORIES(${Cornucopia_SOURCE_DIR}/Cornucopia)
INCLUDE_DIRECTORIES(${Cornucopia_SOURCE_DIR}/DemoUI)

FILE(GLOB DemoUI_CPP "*.cpp")
FILE(GLOB DemoUI_H "*.h")
FILE(GLOB DemoUI_UI "*.ui")

QT4_WRAP_UI(DemoUI_H ${DemoUI_UI})

LIST(APPEND DemoUI_Sources ${DemoUI_CPP} ${DemoUI_H})

QT4_AUTOMOC(${DemoUI_Sources})

#This is for moc files
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

ADD_EXECUTABLE(DemoUI ${DemoUI_Sources})

TARGET_LINK_LIBRARIES(DemoUI Cornucopia ${QT_LIBRARIES})

INSTALL( TARGETS DemoUI RUNTIME DESTINATION bin )

IF(WIN32)
    INSTALL(FILES
        "${QT_BINARY_DIR}/QtCore${QT_VERSION_MAJOR}.dll"
        "${QT_BINARY_DIR}/QtGui${QT_VERSION_MAJOR}.dll"
        "${QT_BINARY_DIR}/QtScript${QT_VERSION_MAJOR}.dll"
        DESTINATION bin
    )
ENDIF(WIN32)